package revise.method;

import java.util.Scanner;

//                                                方法
public class Test {
    //一、方法调用与定义
//    public static int add(int x, int y) {
//        return x + y;
//    }
//    public static void main(String[] args) {
//        Scanner scanner = new Scanner(System.in);
//        while(scanner.hasNextInt()) {
//            int a = scanner.nextInt();
//            int b = scanner.nextInt();
//            int sum = add(a, b);
//            System.out.println("sum = " + sum);
//        }
//    }
    //二、方法重载

    //三、递归
    // n!
    public static int factorResult(int n){
        if (n <= 1){
            return 1;
        } else {
            return factorResult(n - 1) * n;
        }
    }

    // 打印一个数的每一位

    public static void print(int n){
        if (n >= 10){
            print(n / 10);
            System.out.print(n % 10 + " ");
        }
        if (n < 10){
            System.out.print(n + " ");
        }
    }
    public static void main(String[] args) {
        //1.求 n!
//        Scanner scanner = new Scanner(System.in);
//        int n = scanner.nextInt();
//        int result = factorResult(n);
//        System.out.println(result);
        //2.打印一个数的每一位
      Scanner scanner = new Scanner(System.in);
      int n = scanner.nextInt();
      print(n);
    }
}
